package com.share.rule.api;

import com.share.common.core.constant.ServiceNameConstants;
import com.share.common.core.domain.R;
import com.share.rule.domain.FeeRule;
import com.share.rule.domain.FeeRuleRequestForm;
import com.share.rule.domain.FeeRuleResponseVo;
import com.share.rule.factory.RemoteFeeRuleFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(contextId = "remoteFeeRuleService" ,value = ServiceNameConstants.SHARE_RULE,fallbackFactory = RemoteFeeRuleFallbackFactory.class)
public interface RemoteFeeRuleService {


    @PostMapping("/feeRule/getFeeRuleList")
     R<List<FeeRule>> getFeeRuleList(@RequestBody List<Long> feeRuleIds);

    @GetMapping("/feeRule/getFeeRule/{id}")
     R<FeeRule> getFeeRule(@PathVariable("id") Long id);

    @PostMapping("/feeRule/calculateOrderFee")
    R<FeeRuleResponseVo> calculateOrderFee(@RequestBody FeeRuleRequestForm requestForm);
}
